function [t,x] = euler(func,ts,x0,options,data)
% euler method, designed to be consistent with inputs used by the MATLAB
% 'ODE' integrators (somewhat consistent)

nt = length(ts);

x = x0;

for i = 2:nt
    xdot = feval(func,ts(i-1),x(:,i-1),data);
    
    x(:,i) = x(:,i-1) + (ts(i)- ts(i-1))*xdot;
end

t = ts;
x = x';